package com.bocai.grainshop.ware.dao;

import com.bocai.grainshop.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author SunJinBo
 * @email 2374461077@qq.com
 * @date 2022-03-01 20:27:29
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void stock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    Long getStock(@Param("obj") Long obj);

    List<Long> skuWareHasStock(@Param("skuId") Long skuId);

    Long lock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

    void unLockWare(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

}
